< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03080102.xhp

(section: cos) (bookmark: bm_id3154923)
Cos function

Cos関数

Cos Function [Runtime]
Cos 関数 [実行時](hd_id3154923.1)

Calculates the cosine of an angle. The angle is specified in radians. The result lies between -1 and 1.
与えられた角度の Cos (コサイン、余弦) 値を計算します。角度の単位はラジアンです。この関数の戻り値は、-1 から 1 の範囲を取ります。(par_id3159413.2)

(/section: cos)

Using the angle Alpha, the Cos-Function calculates the ratio of the length of the side that is adjacent to the angle, divided by the length of the hypotenuse in a right-angled triangle.
たとえば角度αの Cos 値は、角度αを 1 つの頂角とする直角三角形を想定して、この頂点で交わる辺と斜辺の長さの比 (辺÷斜辺) として計算します。(par_id3150358.3)

Cos(Alpha) = Adjacent/Hypotenuse
Cos (α) = 頂角αに隣接する辺の長さ/斜辺の長さ(par_id3154141.4)

Syntax:
構文:(hd_id3154125.5)

Cos (Number)
Cos (Number)(par_id3145172.6)

Return value:
戻り値:(hd_id3156214.7)

Double
倍精度(par_id3150449.8)

Parameters:
パラメータ:(hd_id3153969.9)

Number: Numeric expression that specifies an angle in radians that you want to calculate the cosine for.
Number: Cos 値を計算させる角度を示す数値表式 (単位はラジアン)。(par_id3153770.10)

To convert degrees to radians, multiply degrees by pi/180. To convert radians to degrees, multiply radians by 180/pi.
通常の角度をラジアン値に変換するには、角度×π/180 と計算します。ラジアン値を通常の角度に変換するには、ラジアン値×180/π と計算します。(par_id3145749.11)

degree=(radian*180)/pi
通常の角度の値 = (ラジアン値*180)/pi(par_id3149664.12)

radian=(degree*pi)/180
ラジアン値 = (通常の角度の値*pi)/180(par_id3146985.13)

Pi is here the fixed circle constant with the rounded value 3.14159...
ここで pi は、円周率πを示す 3.141592657 … という固定値です。(par_id3152885.14)

(embed text/sbasic/shared/00000003.xhp#errorcode : linkinfo)

Error Codes

エラーコード(hd_id3152869.37)

(/embed text/sbasic/shared/00000003.xhp#errorcode)

(embed text/sbasic/shared/00000003.xhp#err5 : linkinfo)

5 Invalid procedure call
5 無効なプロシージャー呼び出しです (par_id3150891.41)

(/embed text/sbasic/shared/00000003.xhp#err5)

Example:
例:(hd_id3153951.15)

REM The following example allows for a right-angled triangle the input of
REM この例では、直角三角形の一辺の長さとその頂角 (通常の角度) を(par_id3155855.16)

REM secant and angle (in degrees) and calculates the length of the hypotenuse:
REM ユーザーに入力させて、斜辺の長さを計算しています。(par_id3149484.17)

Sub ExampleCosinus
Sub ExampleCosinus(par_id3147428.18)

REM rounded Pi = 3.14159
REM Pi = 3.14159 と近似(par_id3150010.19)

Dim d1 as Double, dAngle as Double
Dim d1 as Double, dAngle as Double(par_id3149959.20)

d1 = InputBox$ (""Enter the length of the adjacent side: ","Adjacent")
d1 = InputBox$ ("Enter the length of the adjacent side:","Adjacent")(par_id3144764.21)

dAngle = InputBox$ ("Enter the angle Alpha (in degrees): ","Alpha")
dAngle = InputBox$ ("Enter the angle Alpha (in degrees):","Alpha")(par_id3154491.22)

Print "The length of the hypothenuse is"; (d1 / cos (dAngle * Pi / 180))
Print "The length of the hypothenuse is"; (d1 / cos (dAngle * Pi / 180))(par_id3151074.23)

End Sub
End Sub(par_id3149583.24)


< Prev / Next >